import request from '@/utils/request'
// 题的增删改查     选项的增删改查
export default {
  /**
   *查询题库
   */
  getSoulQuestionById(soulId) {
    return request({
      url: '/soulquest/getSoulQuestionById?souId='+soulId,
      method: 'get'
    })
  },
  /**
   *删除题库
   */
  deleteQuestionById(soulId, questionId) {
    return request({
      url: `/soulquest/deleteQuestionById/${soulId}/${questionId}`,
      method: 'get'
    })
  },
  /**
   *修改题库
   */
  updateQuestion(questionList) {
    return request({
      url: '/soulquest/updateQuestion',
      method: 'post',
      data:  questionList//question:string,questionId
    })
  },
  /**
   *添加题库
   */
  updateSoul(soulId, questionList) {
    return request({
      url: `/soulquest/addQuestion/${soulId}`,
      method: 'post',
      data: questionList
    })
  },

  /**
   * 查询选项
   */
  queryOptions(questionId) {
    console.log('questionid',questionId)
    return request({
      url: '/soulquest/queryOptions?questionId='+questionId,
      method: 'get'
    })
  },
  /**
   *删除选项
   */
  deleteOption(questionId, optionId) {
    console.log('删除选项',questionId,optionId)
    return request({
      url: `/soulquest/deleteOption/${questionId}/${optionId}`,
      method: 'get'
    })
  },
  /**
   *修改选项
   */
  updateOption(questionId, questionOption) {
    console.log('修改选项',questionId,questionOption)
    return request({
      url: `/soulquest/updateOption/${questionId}`,
      method: 'post',
      data:  questionOption
    })
  },
  /**
   *添加选项
   */
  addOption(questionId, questionOption) {
    console.log(9999999,questionId,questionOption)
    return request({
      url: `/soulquest/addOption/${questionId}`,
      method: 'post',
      data:  questionOption
    })
  }
}

